<?xml version="1.0"?>
<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
  <head>
    <link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
    <link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
    <style>
      * {
        <#if .locale == "zh_CN">
        font-family: NotoSans, NotoSansCJKsc, sans-serif;
        <#elseif .locale == "zh_TW">
        font-family: NotoSans, NotoSansCJKtc, sans-serif;
        <#elseif .locale == "ja_JP">
        font-family: NotoSans, NotoSansCJKjp, sans-serif;
        <#elseif .locale == "ko_KR">
        font-family: NotoSans, NotoSansCJKkr, sans-serif;
        <#elseif .locale == "th_TH">
        font-family: NotoSans, NotoSansThai, sans-serif;
        <#else>
        font-family: NotoSans, NotoSansCJKsc, sans-serif;
        </#if>
      }
      * {
        margin: 0;
        padding: 0;
      }
      body {
        width: 21.5cm;
        height: 14cm;
        margin: 0;
        padding: 0;
        text-align: center;
        background-color: #FFFFFF;
        
      }
      table {
        margin: 0 5px;
        table-layout: fixed;
        word-wrap: break-word;
        word-break: break-all; 
      }
      table td {
        font-size: 15px;
        text-align: center;
        word-wrap: break-word;
      }
      table td p {
        width: 100%;
        height: auto;
        color: #000;
        word-wrap: break-word;
        word-break: break-all; 
      }
      table .td1 {
        width: 5%;
      }
      table .td2 {
        width: 10%;
      }
      table .td3 {
        width: 10%;
      }
      table .td4 {
        width: 10%;
      }
      table .td5 {
        width: 10%;
      }
      table .td6 {
        width: 9%;
      }
      table .td7 {
        width: 5%;
      }
      table .td8 {
        width: 5%;
      }
      table .td9 {
        width: 7%;
      }
      table .td10 {
        width: 7%;
      }
      table .td11 {
        width: 7%;
      }
      table .td12 {
        width: 5%;
      }
      table .td13 {
        width: 10%;
      }
      .leftBorder {
        border-left: 1px solid #000000;
      }
      .rightBorder {
        border-right: 1px solid #000000;
      }
      .topBorder {
        border-top: 1px solid #000000;
      }
      .bottomBorder {
        border-bottom: 1px solid #000000;
      }
      .border {
        border: 1px solid #000000;
      }
    </style>
  </head>
  <#list transOrder.items as items>
  <body>
    <table cellspacing="0" cellpadding="0" width="100%" height="100%">
      <tr>
        <td style="width: 5%"></td>
        <td style="width: 10%"></td>
        <td style="width: 10%"></td>
        <td style="width: 12%"></td>
        <td style="width: 11%"></td>
        <td style="width: 9%"></td>
        <td style="width: 5%"></td>
        <td style="width: 5%"></td>
        <td style="width: 6%"></td>
        <td style="width: 6%"></td>
        <td style="width: 6%"></td>
        <td style="width: 5%"></td>
        <td style="width: 10%"></td>
      </tr>
      <tr>
        <td colspan="13">
          <p style="text-align: center;font-size: 20px;font-weight: 600;line-height: 30px;">
            库存调拨单
          </p>
        </td>
      </tr>
      <tr>
        <td colspan="10">
          <p style="text-align: right;font-size: 20px;font-weight: 600;line-height: 30px;">
            — — — ${transOrder.subsidiary}
          </p>
        </td>
        <td colspan="3"></td>
      </tr>
      <tr>
        <td>
          <p style="text-align: left;font-size: 14px;line-height: 20px;">
            部门:
          </p>
        </td>
        <td colspan="8">
          <p style="text-align: left;font-size: 14px;line-height: 20px; text-decoration: underline;">
            ${transOrder.department}
          </p>
        </td>
        <td colspan="5">
          <p style="text-align: center;font-size: 14px;line-height:20px;padding: 0;margin: 0;">
            调拨日期：${transOrder.date}
          </p>
          <p style="text-align: center;font-size: 14px;line-height:20px;padding: 0;margin: 0;">
            NO:${transOrder.tranid}
          </p>
        </td>
      </tr>
      <tr>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">序号</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">调出</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">调入</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">产品描述</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">物料编码</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">规格</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">颜色</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">色号</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">数量</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">单价</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">金额</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">单位</p>
        </td>
        <td class="leftBorder topBorder rightBorder">
          <p style="text-align: center;font-size: 14px;font-weight: 600;line-height: 20px;">备注</p>
        </td>
      </tr>
      <#assign sum = 0>
      <#list items.subItems as item>
      <#assign sum += item.quantity?number>
      <tr>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${items_index * 5 + item_index + 1}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${item.location}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${item.transferLocation}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${item.description}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${item.itemName}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${item.size}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${item.color}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${item.colorNumber}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${item.quantity}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${item.rate}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${item.amount}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${item.units}</p>
        </td>
        <td class="leftBorder topBorder rightBorder">
          <p style="text-align: center;font-size: 10px;line-height: 12px;">${item.remarks}</p>
        </td>
      </tr>
      </#list>
      <tr>
        <td class="leftBorder topBorder" colspan="8">
          <p style="text-align: center;font-size: 12px;line-height: 16px;">小计</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;line-height: 16px;">${sum}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder rightBorder">
          <p style="text-align: center;font-size: 12px;line-height: 16px;"></p>
        </td>
      </tr>
      <tr>
        <td class="leftBorder topBorder" colspan="8">
          <p style="text-align: center;font-size: 12px;line-height: 16px;">总计</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;line-height: 16px;">${transOrder.total}</p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder">
          <p style="text-align: center;font-size: 12px;line-height: 16px;"></p>
        </td>
        <td class="leftBorder topBorder rightBorder">
          <p style="text-align: center;font-size: 12px;line-height: 16px;"></p>
        </td>
      </tr>
      <tr>
        <td class="leftBorder topBorder rightBorder" colspan="13">
          <p style="width: 90%;text-align: right;font-size: 12px;line-height: 16px;">打印次数：${transOrder.printTimes} 次</p>
        </td>
      </tr>
      <tr>
        <td class="leftBorder topBorder bottomBorder" colspan="12">
          <table style="width: 100%;margin: 0;">
            <tr>
              <td colspan="4">
                <p style="text-align:left;font-size: 12px;line-height: 16px;">备注: ${transOrder.memo}</p>
              </td>
            </tr>
            <tr>
              <td>
                <p style="text-align:left;font-size: 12px;line-height: 16px;">制表人:</p>
              </td>
              <td>
                <p style="text-align:left;font-size: 12px;line-height: 16px;">发料人:</p>
              </td>
              <td>
                <p style="text-align:left;font-size: 12px;line-height: 16px;">部门主管:</p>
              </td>
              <td>
                <p style="text-align:left;font-size: 12px;line-height: 16px;">财务部:</p>
              </td>
            </tr>
          </table>
        </td>
        <td class="leftBorder topBorder rightBorder bottomBorder">
          <p style="text-align: center;font-size: 12px;line-height: 16px;"></p>
        </td>
      </tr>
      <tr>
        <td colspan="13">
          <p style="text-align: left;font-size: 12px;line-height: 16px;margin: 5px 0;">
            对加工商产生约束力之任何法律文件，均须经加工负责人或授权人签字方可生效
          </p>
          <p style="text-align: left;font-size: 12px;line-height: 16px;margin: 0;">
            一式四联：第一联（白）：仓库留存联；第二联（蓝）：会计记账；第三联（黄）：加工商留存联；第四联（红）：收货部门留存
          </p>
        </td>
      </tr>
      <tr>
        <td colspan="13">
          <p style="text-align: center;font-size: 12px;line-height: 16px;margin: 5px 0;">
            ${items_index + 1} / ${transOrder.items?size}
          </p>
        </td>
      </tr>
    </table>
  </body>
  </#list>
</pdf>
